using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace InfFront.UICore
{
    // NOTE: There are two switches you have to update when you add a new IDataType
    // The first is at InfFront.UICore.DataTraits.GetTraits and the second is at InfFront.InfoSources.Base.InfoField.DataTypeKind

    /// <summary>
    /// Base data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IDataType
    {
    }

    /// <summary>
    /// Base formattable data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IFormattableDataPresenter
    {
        /// <summary>
        /// Format used to represent the data
        /// </summary>
        [OperationContract]
        string GetFormat();
    }

    /// <summary>
    /// String data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IStringDataDesc : IDataType, IFormattableDataPresenter
    {
        /// <summary>
        /// Max field value length
        /// 0 or -1 - means that the length is unspecified or unknown.
        /// </summary>
        [OperationContract]
        int GetLength();
    }

    /// <summary>
    /// Integer data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IIntDataDesc : IDataType, IFormattableDataPresenter
    {
        /// <summary>
        /// Minimal data value
        /// </summary>
        [OperationContract]
        int GetMinimum();

        /// <summary>
        /// Maximal data value
        /// </summary>
        [OperationContract]
        int GetMaximum();
    }

    /// <summary>
    /// Long integer data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface ILongDataDesc : IDataType, IFormattableDataPresenter
    {
        /// <summary>
        /// Minimal data value
        /// </summary>
        [OperationContract]
        long GetMinimum();

        /// <summary>
        /// Maximal data value
        /// </summary>
        [OperationContract]
        long GetMaximum();
    }

    /// <summary>
    /// Floating point data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IFloatDataDesc : IDataType, IFormattableDataPresenter
    {
        /// <summary>
        /// Minimal data value
        /// </summary>
        [OperationContract]
        double GetMinimum();

        /// <summary>
        /// Maximal data value
        /// </summary>
        [OperationContract]
        double GetMaximum();
    }

    /// <summary>
    /// Date and time data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IDateTimeDataDesc : IDataType, IFormattableDataPresenter
    {
        /// <summary>
        /// Minimal data value
        /// </summary>
        [OperationContract]
        DateTime GetMinimum();

        /// <summary>
        /// Maximal data value
        /// </summary>
        [OperationContract]
        DateTime GetMaximum();
    }

    /// <summary>
    /// Boolean data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IBoolDataDesc : IDataType, IFormattableDataPresenter
    {
    }

    /// <summary>
    /// Image/Icon data description interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IImageDataDesc : IDataType
    {
    }
}
